<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset();?>
	<title>
		<?php echo $title_for_layout; ?>
	</title>
    <meta http-equiv="Content-Language" content="vi" />
    <meta name="description" content="<?php
        if(isset($description)) {
            echo $description;
        } else {
            echo 'Website chia sẻ đề thi, đề kiểm tra trắc nghiệm tự luận, đề ôn luyện miễn phí';
        }
    ?>"/>
    <meta name="keywords" content="<?php
        if(isset($keywords)) {
            echo $keywords;
        } else {
            echo 'chia sẻ, đề thi, đề kiểm tra, kiểm tra, trắc nghiệm, ôn luyện, miễn phí, trực tuyến';
        }
    ?>" />
	<?php
		//echo $this->Html->meta('icon');

		echo $this->Html->css('chomo.main');
        echo $this->Html->css('chomo.form');
        echo $this->Html->css('ddsmoothmenu');
        
        echo $this->Html->script('tiny_mce/tiny_mce.js');
        echo $this->Html->script('ddsmoothmenu.js');

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script language="JavaScript">
        if (top.location != self.location)
        {top.location = self.location}
    </script>
    <script type="text/javascript">
        ddsmoothmenu.init({
        	mainmenuid: "ddsmoothmenu1", //menu DIV id
        	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
        	classname: 'ddsmoothmenu', //class added to menu's outer DIV
        	//customtheme: ["#1c5a80", "#18374a"],
        	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
        });
        
        ddsmoothmenu.init({
        	mainmenuid: "smoothmenu2", //Menu DIV id
        	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
        	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
        	//customtheme: ["#804000", "#482400"],
        	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
        });
    
        tinyMCE.init({
            theme : "advanced",
            mode : "textareas",
            plugins : "paste,equation",
            theme_advanced_buttons1 : "equation, |, bold, italic, underline, |, justifyleft, justifycenter, justifyright, justifyfull",
            theme_advanced_buttons2 : "",
            theme_advanced_buttons3 : "",
            paste_auto_cleanup_on_paste : true,
            force_p_newlines : false,
            force_br_newlines : true,
            forced_root_block : false
        });
        
        $(document).ready(function(){
            $('.slidingDiv').hide();
            $('.show_hide').show();
            
            $('.show_hide').click(function(){
            $('html, body').animate({scrollTop:$('.slidingDiv').offset().top - 20}, 'slow');
            $('.slidingDiv').slideToggle();
            });
        });
    </script>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-31809718-1']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    <meta name="google-site-verification" content="v4kU7EvKNMJDrKcmIrQyPB7LW9NNPSmmNbvKUoH-KH8" />
</head>
<body>
<div id="container-border">
	<div id="container">
        <div id="user-box-container">
            <div id="user-box">
<?php
                if($logged_in) {
?>
                <table border="0">
                    <tr>
                        <td>Xin chào</td>
                        <td class="name">
                            <?php echo $this->Html->link($this->Session->read('Chomo.Current.User'), array('controller' => 'users', 'action' => 'view', $this->Session->read('Chomo.Current.Id')));?>
                            <?php echo $this->Html->link('[Xem thông tin cá nhân]', array('controller' => 'users', 'action' => 'view', $this->Session->read('Chomo.Current.Id')));?>
                        </td>
                        <td class="border"></td>
                        <td><?php echo $this->Html->link('Thoát', array('controller' => 'users', 'action' => 'logout'));?></td>
                    </tr>
                </table>
<?php
                } else {
?>
                <table border="0">
                    <tr>
                        <td><?php echo $this->Html->link('Đăng nhập', array('controller' => 'users', 'action' => 'login'));?></td>
                        <td class="border"></td>
                        <td><?php echo $this->Html->link('Đăng ký', array('controller' => 'users', 'action' => 'register'));?></td>
                    </tr>
                </table>
<?php
                }
?>
            </div>
        </div>
		<div id="header">
<?php
        echo $this->Html->image('bannel.png', array('url' => array('controller' => 'index', 'action' => 'index')));
?>
		</div>
<?php
            echo $this->element('menu');
?>
        <div class="clear"></div>
        <div id="left-content">
            <div id="content">
    			<?php echo $this->Session->flash(); ?>
    			<?php echo $this->fetch('content'); ?>
    		</div>
        </div>
        <div id="right-content">
            <br />
<?php
            //echo $this->element('clock');
            echo $this->element('menu-doc');
?>
        </div>
        <div class="clear"></div>
		<div id="footer">
            Bản quyền &copy; 2012 bởi CHOMOTECH
		</div>
	</div>
 </div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>